Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the behavior of the yellow thread highlight after exiting a thread #51533

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

ishpaul777
Copy link
Contributor

@ishpaul777 ishpaul777 commented Oct 26, 2024

Details

Fixed Issues

$ #42165
PROPOSAL: #42165 (comment)

Tests

  • Verify that no errors appear in the JS console
  1. send a message in any report and Copy a message link.
  2. send copied message link in report and click on it.
  3. Observe the message is highlighted.
  4. Now send a message in chat Verify: Message is no longer highlighted
  5. Repeat step 1, 2 and 3
  6. As another user send message in same report, Verify: Message is still highlighted
  7. Repeat step 1, 2 and 3
  8. Click on + icon in composer and click any option, Verify: Message is no longer highlighted
  9. Repeat step 1, 2 and 3
  10. Click into any other message thread and navigate back with back button, Verify: Message is no longer highlighted

Offline tests

QA Steps

  • Verify that no errors appear in the JS console
    Same as test steps

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2024-10-27.at.2.39.12.AM.mov
Screen.Recording.2024-10-27.at.2.39.47.AM.mov
Android: mWeb Chrome
Screen.Recording.2024-10-27.at.2.54.41.AM.mov
iOS: Native
Screen.Recording.2024-10-27.at.5.39.35.AM.mov
iOS: mWeb Safari
Screen.Recording.2024-10-27.at.2.17.07.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-10-27.at.2.10.47.AM.mov
MacOS: Desktop
Screen.Recording.2024-10-28.at.1.34.17.AM.mov

@ishpaul777 ishpaul777 changed the title Fix/42165 Update the behavior of the yellow thread highlight after exiting a thread Oct 26, 2024
@ishpaul777 ishpaul777 marked this pull request as ready for review October 27, 2024 20:15
@ishpaul777 ishpaul777 requested a review from a team as a code owner October 27, 2024 20:15
@melvin-bot melvin-bot bot requested review from sobitneupane and removed request for a team October 27, 2024 20:15
Copy link

melvin-bot bot commented Oct 27, 2024

@sobitneupane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@sobitneupane
Copy link
Contributor

Thanks @ishpaul777 I will try to review the PR by EOD.

@ishpaul777
Copy link
Contributor Author

Resolved conflicts and synced main

@sobitneupane
Copy link
Contributor

@ishpaul777 We want to remove the highlight only on specific actions:

Clicking out of the chat into another chat
Clicking into another thread
Sending a new comment in the same chat (but not receiving a comment from another user)
Taking any action from the + menu while in the chat

However, with the changes in this PR, the highlight is also being removed for actions like opening the context menu, emoji picker, and FAB, which is unintended.

Also, the highlight should ideally only be removed when opening the RHP (after clicking Submit Expense, Split Expense, etc.) not when clicking + on the Composer.

@ishpaul777
Copy link
Contributor Author

ishpaul777 commented Nov 5, 2024

i clarified this here and in proposal here, i can try to refactor this to acheive what you explain but can we confirm this again from desgin team?

Taking any action from the + menu while in the chat ✅ (it goes away as soon as we open any popover)

We remove highlight when any modal (RHP, LHP, Popover) is visible and when sending a message, here we dont remove highlight when refreshing as it will cause regressions in scrolling etc. and its also same behaviour as slack

@sobitneupane
Copy link
Contributor

i can try to refactor this to acheive what you explain but can we confirm this again from desgin team?

@ishpaul777 Yup. Can you please start the discussion in the issue.

@ishpaul777
Copy link
Contributor Author

However, with the changes in this PR, the highlight is also being removed for actions like opening the context menu, emoji picker, and FAB, which is unintended.

I thought about it and i think what said make sense to me, I made changes accourding to your review comment, please re-review

@ishpaul777
Copy link
Contributor Author

@sobitneupane BUMP!

@ishpaul777
Copy link
Contributor Author

ishpaul777 commented Nov 17, 2024

Mereged main.

@sobitneupane Friendly bump! for review

@sobitneupane
Copy link
Contributor

Sorry for the delay @ishpaul777

I will try to get it done asap.

@ishpaul777
Copy link
Contributor Author

Any updates @sobitneupane

@sobitneupane
Copy link
Contributor

@ishpaul777 Let's add the test cases in QA section as well.

Now send a message in chat Verify: Message is no longer highlighted

Should we also add a case to receive message from another user and verify message is still highlighted?

click on + icon in composer, Verify: Message is no longer highlighted

I believe we should change this test case to Click on + icon in composer and take any action.

On native apps and small screen devices as soon as I click on + icon, the message is no longer highlighted.

Click into any other message thread and navigate back with back button, Verify: Message is no longer highlighted

This test doesn't pass. When I navigate back with back button, Message is still highlighted.

Screen.Recording.2024-11-25.at.18.02.37.mov

@ishpaul777
Copy link
Contributor Author

i have adressed all comments 47bf7ce, Its up for review again @sobitneupane

@ishpaul777
Copy link
Contributor Author

I just noticed Perf test is failing, i'll check that soon...

@sobitneupane
Copy link
Contributor

Any update @ishpaul777?

@ishpaul777
Copy link
Contributor Author

I had limited available past week, will look into it tmrw

@ishpaul777
Copy link
Contributor Author

@sobitneupane Perf test are fixed

@sobitneupane
Copy link
Contributor

@ishpaul777 As seen in the video, when a thread is highlighted and we open the RHP through any action, there is no animation during the transition. This behavior differs when the thread is not highlighted.

Screen.Recording.2024-12-10.at.15.20.56.mov

@ishpaul777
Copy link
Contributor Author

@sobitneupane I could not reproduce this

Screen.Recording.2024-12-10.at.3.22.08.PM.mov

@sobitneupane
Copy link
Contributor

ON native, the thread remains highlighted even after taking some action like "Split expense".

Screen.Recording.2024-12-10.at.15.59.41.mov

@sobitneupane
Copy link
Contributor

Reproducible in web and mWeb.

Steps to reproduce:

  1. Highlight message 1
  2. Highlight message 2
  3. Highlight message 1
  4. Open message 2 and press back button
  5. Notice that message 1 is still highlighted.
Screen.Recording.2024-12-10.at.16.16.57.mov

@sobitneupane
Copy link
Contributor

sobitneupane commented Dec 10, 2024

@ishpaul777 Regarding #51533 (comment), could you please test it in an account with high traffic.

@ishpaul777
Copy link
Contributor Author

#51533 (comment) and #51533 (comment) is fixed, now we will remove the navigation param for reportActionId on small screen which will scroll the user to bottom of the chat. we do this on small screen only becuase if we do this on desktop scroll and jitter is noticable on the background

Screen.Recording.2024-12-10.at.4.50.56.PM.mov
Screen.Recording.2024-12-10.at.4.52.31.PM.mov

@ishpaul777
Copy link
Contributor Author

@ishpaul777 Regarding #51533 (comment), could you please test it in an account with high traffic.

i was able to reproduce this only when the a thread is highlighted in large chat, it seem to be removing the highight color is inturupting the transition animation, i have a fix to use InteractionManager.runAfterInteractions while removing highlight but that will cause a slight delay in removing highlight color, lmk if that sound good to you @sobitneupane

Screen.Recording.2024-12-10.at.5.01.56.PM.mov

@sobitneupane
Copy link
Contributor

now we will remove the navigation param for reportActionId on small screen which will scroll the user to bottom of the chat.

I don't think this is something we want. As you can see in this comment, we decided not to go with the idea of removing reportActionID because of unwanted scrolling.

@sobitneupane
Copy link
Contributor

sobitneupane commented Dec 12, 2024

i was able to reproduce this only when the a thread is highlighted in large chat, it seem to be removing the highight color is inturupting the transition animation, i have a fix to use InteractionManager.runAfterInteractions while removing highlight but that will cause a slight delay in removing highlight color

This looks much better than the existing condition . I am okay with it.

@ishpaul777
Copy link
Contributor Author

I don't think this is something we want. As you can see in #42165 (comment), we decided not to go with the idea of removing reportActionID because of unwanted scrolling.

On small screen its unnoticable since user already took a action it does not make any sense to keep user linked on the comment, if we dont remove param and it is just acting as user is refreshed page on now landed on comment link first time that's why it show the comment linked. if you notice we did remove the highlight when user navigates but it comes again when we go back becuase reportactionid in param when we go back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants